import 'package:flutter/material.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
import 'package:provider/provider.dart';
import 'package:untitled/pages/counter.dart';

class Details extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Ddetails"),
      ),
      body: MyDetails(),
    );
  }
}

class MyDetails extends StatefulWidget {
  @override
  _DetailsState createState() => _DetailsState();
}

class _DetailsState extends State<MyDetails> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
      Text('${Provider.of<Counter>(context).count}'),
        FilledButton(
            onPressed: () {
              print("点击了");
              showToast("hello styled toast",context:context);
              Navigator.pushNamed(context, '/seting');
            },
            child: Text("Click Me"))
      ],
    );
  }
}